package www.openteam.com.presenter.business;

import android.util.Log;

import www.openteam.com.bean.ApprovalStatu;
import www.openteam.com.bean.InsertStatus;
import www.openteam.com.model.business.UpdateCustomOrderItemInfoModel;
import www.openteam.com.model.business.UpdateCustomOrderItemInfoModelImpl;
import www.openteam.com.view.business.UpdateCustomOrderItemInfoView;

/**
 * Created by kylin on 2016/12/2.
 */

public class UpdateCustomOrderItemInfoPresenterImpl implements UpdateCustomOrderItemInfoModelImpl.
        UpdateCustomOrderInfoOnListener, UpdateCustomOrderItemInfoPresenter {

    private static final String TAG = UpdateCustomOrderItemInfoPresenterImpl.class.getSimpleName();
    private UpdateCustomOrderItemInfoModel updateCustomOrderItemInfoModel;
    private UpdateCustomOrderItemInfoView updateCustomOrderItemInfoView;

    public UpdateCustomOrderItemInfoPresenterImpl(UpdateCustomOrderItemInfoView updateCustomOrderItemInfoView) {
        this.updateCustomOrderItemInfoView = updateCustomOrderItemInfoView;
        this.updateCustomOrderItemInfoModel = new UpdateCustomOrderItemInfoModelImpl(this);
    }

    @Override
    public void updateCOISuccess(ApprovalStatu updateState) {
        this.updateCustomOrderItemInfoView.updateCOIData(updateState);
    }

    @Override
    public void updateCOIFail(Throwable throwable) {
        this.updateCustomOrderItemInfoView.hideCOIData(throwable);
    }

    @Override
    public void updateCOMISuccess(ApprovalStatu updateState) {
        this.updateCustomOrderItemInfoView.updateCOMIData(updateState);
    }

    @Override
    public void updateCOMIFail(Throwable throwable) {
        this.updateCustomOrderItemInfoView.hideCOMIData(throwable);
    }

    @Override
    public void updateCustomOrderItemInfo(int id, String prodno, String wraptype, String paperinf, String senddate, String technicsinf, String printcolor, String paynumb, String othernumb, String price, String eprodno) {
        Log.d(TAG, "updateCustomOrderItemInfo: ");
        this.updateCustomOrderItemInfoModel.updateCustomOrderItemInfo(id, prodno, wraptype, paperinf, senddate, technicsinf, printcolor, paynumb, othernumb, price, eprodno);
    }


    @Override
    public void insertCustomOrderItemInfo(int id, String prodno, String wraptype, String paperinf, String senddate, String technicsinf, String printcolor, String paynumb, String othernumb, String price ) {
        Log.d(TAG, "updateCustomOrderItemInfo: ");
        this.updateCustomOrderItemInfoModel.insertCustomOrderItemInfo(id, prodno, wraptype, paperinf, senddate, technicsinf, printcolor, paynumb, othernumb, price);
    }

    @Override
    public void updateCustomOrderMainInfo(int id, String rdsno, String custid, String userid, String moneytype, String paytime, String sendtype, String custorderid, String alreadlypay, String inputdate, String inputer, String orderamount, String remark, String orderdate, String sendaddress, String istax, String taxrate, String invtype, String stype) {
       this.updateCustomOrderItemInfoModel.updateCustomOrderMainInfo(id, rdsno, custid, userid, moneytype, paytime, sendtype, custorderid, alreadlypay, inputdate, inputer, orderamount, remark, orderdate, sendaddress, istax, taxrate, invtype, stype);
    }
}
